#include "../include/double_Sql_list.h"
#include "../include/file.h"

Log_in_data data[3] = 
{
 { .name = "刘备" , .password = "123" ,  .id = 1  },
 { .name = "关羽" , .password = "123" ,  .id = 1  },
 { .name = "张飞" , .password = "123" ,  .id = 1  }
};

void test(void)
{
    // 对链表进行初始化
    Double_Link_List * dom_list = init_double_link_list();  // 普通用户 
    Double_Link_List * root_list = init_double_link_list(); // 管理员用户

    // 数据的载入
    insert_double_node( root_list , data[0] , 1 );
    insert_double_node( root_list , data[1] , 2 );
    insert_double_node( root_list , data[2] , 3 );

    // 遍历数据
    print_forward_double_link_list(root_list);

    // 写入到文件
    F_print(root_list , "hqyj.txt");

    F_scanf(dom_list , "hqyj.txt");
    
    print_forward_double_link_list(root_list);
    print_forward_double_link_list(dom_list);

    // 释放链表
    free_double_link_list(&dom_list);
    free_double_link_list(&root_list);

}

int main(int argc, char const *argv[])
{
    test();
    return 0;
}




